<template>
  <p>ref demo {{ageRef}} {{state.name}}</p>
</template>

<script>
import { ref, reactive } from "vue";

export default {
  setup() {
    const ageRef = ref(20) // 值类型 响应式
    const nameRef = ref('张梦思')

    const state = reactive({
      name: nameRef
    })

    setTimeout(() => {
      ageRef.value = 25
      nameRef.value = 'jjj'
    }, 1500);

    return {
      ageRef,
      state
    }
  },
}
</script>
